package com.example.chap03.dao;

import com.example.demo.entity.Sys_role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;


@Repository
public class Sys_roleDaoImpl{
    @Autowired
    private JdbcTemplate jdbcTemplate;

    public int saveSys_role(Sys_role sys_role) {
        String sql = "insert into sys_role(name,description,create_time,create_by,update_time,update_by,del_flag)"+
               "values(?,?,?,?,?,?,?)" ;
        int result = jdbcTemplate.update(sql, new Object[]{sys_role.getName(),
                sys_role.getDescription(""), sys_role.getCreate_time(), sys_role.getCreate_by(),
                sys_role.getUpdate_time(), sys_role.getUpdate_time(), sys_role.getDel_flag()});

        return result;
    }


}
